//package com.toolconclusion.listener;//package com.codingfuture.glaciercollect.listener;
////
////
////import com.alibaba.fastjson.JSON;
////import com.codingfuture.glaciercollect.dto.THDateDTO;
////import com.codingfuture.glaciercollect.service.MeterRecordService;
////import net.dreamlu.iot.mqtt.spring.client.MqttClientTemplate;
////import org.springframework.beans.factory.annotation.Autowired;
////import org.springframework.data.redis.connection.Message;
////import org.springframework.data.redis.connection.MessageListener;
////import org.springframework.data.redis.core.StringRedisTemplate;
////import org.springframework.stereotype.Component;
////
////import java.nio.charset.StandardCharsets;
////
/////**
//// * @Author: Sun
//// * @DateTime: 2025/4/10 16:29
//// * @Description:
//// **/
////@Component
////public class HumTemListener implements MessageListener {
////    @Autowired
////    private MeterRecordService meterRecordService;
////    @Autowired
////    private StringRedisTemplate redisTemplate;
////    @Override
////    public void onMessage(Message message, byte[] pattern) {
////
////    }
////}
////   /* @Override*/
//////    public void onMessage(Message message, byte[] pattern) {
//////
//////
//////        // 获取监听的管道名
//////        String channel = new String(message.getChannel(), StandardCharsets.UTF_8);
//////        // 获取接收到的消息内容
//////        String content = new String(message.getBody(), StandardCharsets.UTF_8);
//////
//////        THDateDTO thDateDTO = JSON.parseObject(content, THDateDTO.class);
//////        thDateDTO.setSn(channel);
//////        System.err.println(thDateDTO);
//////        //发布消息
//////        String jsonResult = JSON.toJSONString(thDateDTO);//把结果类转化为JSON发布出去
//////        redisTemplate.convertAndSend("htDate",jsonResult);
//////        //插入详细数据
//////        meterRecordService.addInfor(thDateDTO);
//////    }
//////}
////
////
////
////
